//
//  ViewController.swift
//  test_cpp_lib
//
//  Created by CallMeDoby on 2021/1/3.
//

import UIKit

func cpp_swiftFuncIMP(value: Int32) -> Void {
    print("cpp call swift func: \(value)");
}

func c_swiftFuncIMP(value: Int32) -> Void {
    print("c call swift func: \(value)")
}

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        //MARK: swift x oc
        let person = OCPerson()
        let name = person.getName()
        person.printInfo()
        print("oc person name = \(name)")
        person.callSwiftFunc()
        
        //MARK: swift x c
        c_printHello()
        c_swiftFuncIMP = c_swiftFuncIMP(value:)
        c_callSwiftFunc(3333)
        
        //MARK: swift x cpp
        cpp_swiftFuncIMP = cpp_swiftFuncIMP(value:)
        let p = PMCreateBy("p", 33, 1)
        let pname = PMGetName(p)
        print("swift call cpp: p = \(String.init(cString: pname!))")
        PMPrintInfo(p)
        PMCallSwift(p, 2222)
        PMDestoryModel(p)
        
        
        
    }


}

